package cn.imvc.app.repositories;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import cn.imvc.app.entities.Article;
import cn.imvc.app.entities.ArticleClass;
import cn.imvc.data.jpa.repository.IJpqlExecutor;
import cn.imvc.data.jpa.repository.ISqlExecutor;

public interface ArticleRepository extends JpaRepository<Article, Integer>, IJpqlExecutor<Article>,ISqlExecutor<Object> {
	Page<Article> findByArticleClassAndIsShowOrderByTimeDesc(ArticleClass articleClass, Byte isShow, Pageable page);
	Page<Article> findByIsShowOrderByTimeDesc(Byte isShow, Pageable page);
	List<Article> findByTitleAndArticleClass(String title, ArticleClass articleClass);
}
